package com.zxy.supplier_system.server.controller

import com.zxy.supplier_system.server.service.MobileAppVersionService
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("mobileAppVersions")
class MobileAppVersionController(
    private val mobileAppVersionService: MobileAppVersionService,
) {

    @GetMapping("latest")
    fun getUpdatableAppVersion(clientVersion:String): VersionResponse? {
        return this.mobileAppVersionService.getLatest(clientVersion)
    }

    data class VersionResponse(
        val version: String,
        val updateNotes: List<String>,
    )

}